<?php
$contents = array();
if (isset($eventId) && $eventId > 0) {
    $eventTable = new BAEventSheet();
    $event = $eventTable->getListById($eventId);
    $eventName = $event->getItem('name')->getValue(); //作为属性
    $manageEventContentTable = new BAEventSheet($event);
    $contents = $manageEventContentTable->getView();
}
?>
<script type="text/javascript">
    $(document).ready(function() {
        $("#selectAll").click(function() {
            if ($(this).attr("checked") == "checked") {
                $(":checkbox").attr("checked", true);
            } else {
                $(":checkbox").attr("checked", false);
            }
        });

    });
</script> 
<legend>
    <h4>
        <?php echo $control->getAjaxLink(array('name' => '活动列表', 'id' => 'showManage')); ?>\       
        <?php echo '管理活动'; ?>
    </h4>
</legend>
<table class="table table-hover">
    <thead>
        <tr>
            <th><input type="checkbox" id="selectAll"></th>
            <th><?php echo $eventName; ?> </th>
            <th>操作 </th>
        </tr> 
    </thead>
    <tbody>
        <?php
        foreach ($contents as $content) {
            $contentId = $content->getId();
            ?>
            <tr>
                <td><label class="checkbox">
                        <input type="checkbox" name="checkbox[]" value="<?php echo $contentId; ?>"> 
                    </label>
                </td>
                <td> <?php echo $content->getItem('honourName')->getValue(); ?>
                </td>
                <td>
                    <div class="row-fluid">
                        <?php
                        echo $control->getAjaxLink(array('name' => '修改', 'id' => 'modifyManageEventContentofHonour'), array('eventId' => $eventId, 'contentId' => $contentId, 'manageView' => $manageView));
                        echo " | ";
                        echo $control->getAjaxLink(array('name' => '删除', 'id' => 'deleteManageEventContent'), array('eventId' => $eventId, 'contentId' => $contentId, 'manageView' => $manageView));
                        ?>
                    </div>                   
                </td>
            </tr>
            <?php
        }
        ?>
    </tbody>
</table>
<?php
echo $control->getAjaxLink(array('name' => '新增内容', 'id' => 'showAddManageEventContentofHonour'), array(
    'eventId' => $eventId,
    'manageView' => $manageView,
    'contentId' => 0,
    'htmlOptions' => array('class' => 'btn')
));
?>